﻿#ifndef MYINTVALIDATOR_H
#define MYINTVALIDATOR_H

#include <QObject>
#include <QIntValidator>

class MyIntValidator : public QIntValidator
{
    Q_OBJECT
public:
    explicit MyIntValidator(QObject* parent = 0) : QIntValidator(parent){}
    MyIntValidator(int bottom, int top, QObject* parent) : QIntValidator(
                                                              bottom, top, parent){}
    ~MyIntValidator() {}
    virtual void setRange(int bottom, int top)
    {
        QIntValidator::setRange(bottom, top);
    }
    virtual State validate(QString &s, int &n) const
    {
        return QIntValidator::validate(s, n);
    }
    virtual void fixup(QString &s) const
    {
        s = QString("%1").arg(bottom());
    }
};

#endif // MYINTVALIDATOR_H
